class Myrunable implements Runnable{
    volatile boolean isQuit = false;
    @Override
    public void run(){
        while(!isQuit){
            System.out.println("我忙着工作呢"+Thread.currentThread().getName());
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
        System.out.println("抱歉还好来得及");
    }
}
public class Demo47 {
    public static void main(String[] args) throws InterruptedException {
        Myrunable targer = new Myrunable();
        Thread t= new Thread(targer,"李四");
        t.start();
        System.out.println("让李四开始转账");
        Thread.sleep(3000);
        System.out.println("老板说那个是骗子,快停下");
targer.isQuit = true;
    }
}
